<!DOCTYPE html>
<html>
<head>
  <title>The Food Rescue Robot</title>
  <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.5.1/build/cssreset/cssreset-min.css">
  <link href='http://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'>
  <link rel="shortcut icon" href="/favicon.ico" type="image/ico" />
  <%= stylesheet_link_tag    "active_scaffold", "common", "main", "navigation", "welcome", "test", :media => "all" %>
  <%= stylesheet_link_tag "gmaps4rails" %>
  <%= javascript_include_tag "application" %>
  <%= javascript_include_tag :highcharts  %>
  <%= csrf_meta_tags %>
  <script type="text/javascript" language="javascript" src="/DataTables-1.9.2/media/js/jquery.dataTables.min.js"></script>
  <link rel="stylesheet" type="text/css" href="/DataTables-1.9.2/media/css/demo_table.css">
</head>
<body>
  <div class="container">
  <div class="navigation">
    <% unless current_volunteer.nil? %>
    <div id="cssmenu">
      <li>
        <a href="/volunteers/home">
          <span>Home</span>
        </a>
      </li>
        <li class='has-sub'>
          <a href="#">
            <span>Schedule</span>
          </a>
          <ul>
          <li>
            <a href="/schedules/mine">My Schedule</a>
          </li>
          <li>
            <a href="/schedules/open">Unassigned</a>
          </li>
          <% if current_volunteer.any_admin? %>
          <li>
           <a href=<%= schedules_path %>>
             <span>Full Schedule</span>
           </a>
          </li>
            <a href=<%= yesterday_schedules_path %>>
              <span>Yesterday</span>
            </a>
          </li>
          <li>
            <a href=<%= today_schedules_path %>>
              <span>Today</span>
            </a>
          </li>
          <li>
            <a href=<%= tomorrow_schedules_path %>>
              <span>Tomorrow</span>
            </a>
          </li>
  <% end %>
          </ul>
        </li>
      <% if volunteer_signed_in? %>
        <li class="has-sub">
          <a href="#">
            <span>Shifts</span>
          </a>
          <ul>
            <li>
              <a href="/logs/mine_upcoming">Upcoming Shifts</a>
            </li>
            <li>
              <a href="/logs/mine_past">Past Shifts</a>
            </li>
            <li>
              <a href="/logs/open">Cover Shifts</a>
            </li>
            <li>
              <a href=<%= new_absence_logs_path %>>
                <span>Schedule Absence</span>
              </a>
            </li>
          </ul>
        </li>
      <% end %>
      <% if volunteer_signed_in? and current_volunteer.regions.length > 0 %>
        <li class="has-sub">
          <a href="#">
            <span>Handbook</span>
          </a>
          <ul>
            <% current_volunteer.regions.each{ |r| 
                 next if r.handbook_url.nil?
            %>
            <li>
              <a href="<%= r.handbook_url %>">
                <span><%= r.name %></span>
              </a>
            </li>
            <% } %>
          </ul>
        </li>
      <% end %>
      <% if volunteer_signed_in? and current_volunteer.any_admin? %>
        <li class='has-sub'>
          <a href="#" class="<%= "selected" if request.fullpath == volunteers_path %>">
            <span>Volunteers</span>
          </a>
          <ul>
            <li>
             <a href=<%= volunteers_path %> class="<%= "selected" if request.fullpath == volunteers_path %>">
             <span>Full List</span>
            </a>
            <li>
              <a href=<%= shiftless_volunteers_path %> class="<%= "selected" if request.fullpath == shiftless_volunteers_path %>">
                <span>Shiftless</span>
              </a>
            </li>
            <li>
              <a href=<%= need_training_volunteers_path %> class="<%= "selected" if request.fullpath == need_training_volunteers_path %>">
                <span>Need Training</span>
              </a>
            </li>
            <li>
              <a href=<%= unassigned_volunteers_path %> class="<%= "selected" if request.fullpath == unassigned_volunteers_path %>">
                <span>Unassigned</span>
              </a>
            </li>
            <li>
              <a href=<%= assignments_path %> class="<%= "selected" if request.fullpath == assignments_path %>">
                <span>Assignments</span>
              </a>
            </li>
          </ul>
        </li>
      <% end %>
      <% if volunteer_signed_in? and current_volunteer.any_admin? %>
        <li class='has-sub'>
          <a href="#" class="<%= "selected" if request.fullpath == logs_path %>">
            <span>Rescue Log</span>
          </a>
          <ul>
            <li>
             <a href=<%= last_ten_logs_path %>>
               <span>Last 10 Days</span>
             </a>
            </li>
            <li>
              <a href=<%= yesterday_logs_path %> class="<%= "selected" if request.fullpath == yesterday_logs_path %>">
                <span>Yesterday</span>
              </a>
            </li>
            <li>
              <a href=<%= today_logs_path %> class="<%= "selected" if request.fullpath == today_logs_path %>">
                <span>Today</span>
              </a>
            </li>
            <li>
              <a href=<%= tomorrow_logs_path %> class="<%= "selected" if request.fullpath == tomorrow_logs_path %>">
                <span>Tomorrow</span>
              </a>
            </li>
            <li>
              <a href=<%= logs_path %> class="<%= "selected" if request.fullpath == logs_path %>">
                <span>Entire Log</span>
              </a>
            </li>
            <li>
              <a href=<%= tardy_logs_path %> class="<%= "selected" if request.fullpath == tardy_logs_path %>">
                <span>Tardy</span>
              </a>
            </li>
            <a href=<%= being_covered_logs_path %> class="<%= "selected" if request.fullpath == being_covered_logs_path %>">
                <span>Being Covered</span>
              </a>
            </li>

          </ul>
        </li>
      <% end %>
      <% if volunteer_signed_in? and current_volunteer.any_admin? %>
        <li class='has-sub '>
          <a href='#'><span>Administration</span></a>
		  <ul>
		    <li>
		      <a href=<%= recipients_locations_path %> class="<%= "selected" if request.fullpath == recipients_locations_path %>">
		        <span>Recipients</span>
		      </a>
		    </li>
                    <li>
                      <a href=<%= donors_locations_path %> class="<%= "selected" if request.fullpath == donors_locations_path %>">
                        <span>Donors</span>
                      </a>
                    </li>

                    <li>
                      <a href="/volunteers/admin">Controls</a>
                    </li>
                    <li>
                      <a href="/logs/stats">Statistics</a>
                    </li>
          <% if current_volunteer.super_admin? %>
          <li>
            <a href=<%= food_types_path %> class="<%= "selected" if request.fullpath == food_types_path %>">
              <span>Food Types</span>
            </a>
          </li>
          <li>
            <a href=<%= transport_types_path %> class="<%= "selected" if request.fullpath == transport_types_path %>">
              <span>Transport Types</span>
            </a>
          </li>
          <li>
            <a href=<%= cell_carriers_path %> class="<%= "selected" if request.fullpath == cell_carriers_path %>">
              <span>Cell Carriers</span>
            </a>
          </li>
          <li>
            <a href=<%= regions_path %> class="<%= "selected" if request.fullpath == regions_path %>">
              <span>Regions</span>
            </a>
          </li>
          <% end %>
		  </ul>
        </li>
      <% end %>
      <% if volunteer_signed_in? %>
        <li id="user_controls" class="has-sub">
          <a href="#">
          	<span><%= current_volunteer.name%></span>
          </a>
          <ul>
            <li>
                  <%= link_to('Settings', edit_volunteer_path(current_volunteer.id)) %>
           </li>
           <li>
          	  <%= link_to('Account', edit_volunteer_registration_path) %>
           </li>
           <li>
                  <%= link_to('Waiver', '/volunteers/waiver') %>
           </li>
           <li>
          	  <%= link_to('Logout', destroy_volunteer_session_path, :method => :delete) %>
           </li>
          </ul>
        </li>
    <% end %>
    </div>
    <% end %>
  </div>
  <div class="header">
    <% if volunteer_signed_in? and !current_volunteer.main_region.nil? %>
    <div>
      <h2 id="bfr_title"><%= current_volunteer.main_region.title %></h2>
      <h3><%= current_volunteer.main_region.tagline %></h3>
    </div>
    <%= link_to current_volunteer.main_region.website do image_tag(current_volunteer.main_region.logo(:thumb), :class => 'logo_image') end %>
    <% else %>
    <div>
      <h2 id="bfr_title">The Food Rescue Robot</h2>
      <h3>Just-in-Time Food Rescue Logistics</h3>
    </div> 
    <% end %> 
  </div>
  <div class="wrap">    
    <% if notice %>
     <div class="notice"><%= notice %></div>
    <% end %>
    <% if alert %>
     <div class="alert"><%= alert %></div>
    <% end %>
    <%= yield %>
  </div>
  
  <div class="footer">
    <p>Copyright © <a href="http://www.boulderfoodrescue.org">Boulder Food Rescue</a> <%= Time.now.year %></p>
  </div>
  </div>

  <%= yield :scripts %>

</body>
</html>
